var WanderManager = function(){
	this.interact = function(tpf,entities){
		for(var i=0;i<entities.length;i++){
		
		entities[i].wanderComponent.direction+=(Math.random()-0.5)*30*tpf;

		forward = Math.cos(entities[i].wanderComponent.direction)*entities[i].wanderComponent.radius;
		side = Math.sin(entities[i].wanderComponent.direction)*entities[i].wanderComponent.radius;

		
		currentDirection = entities[i].vehicleComponent.velocity.normalize(1);


		frontOfEntityOffset = currentDirection.x(entities[i].wanderComponent.distance);
		turnDirectionOffset = new Vector.create([forward,side]).rotate(currentDirection.angleFrom(Vector.create([0,1])),Vector.Zero(2) );
		
		totalOffset = frontOfEntityOffset.add(turnDirectionOffset);
		
		entities[i].wanderComponent.frontOfEntityOffset = frontOfEntityOffset;
		entities[i].wanderComponent.totalOffset = totalOffset;
		
		entities[i].vehicleComponent.steering_direction=entities[i].vehicleComponent.steering_direction.add(totalOffset).x(entities[i].wanderComponent.weight);
		}
	}
}